Page({
  data: {
    lists: []
  },
  onLoad(option){
    this.getData(option.id)
  },

  // 地区获取楼盘
  getData(id) {
    let that = this
    // 地区area编号
    wx.request({
      url: `https://jc.loupan.com/index.php?c=house&m=get_house_combox_list&page=1&area=${id}`,
      success: function(res) {
        that.setData({
          lists: res.data
        })
      }
    })
  },
  viewmap(e) {
    const query = JSON.stringify(e.currentTarget.dataset.item)
    const url = '/pages/map/map?query=' + encodeURIComponent(query)
    wx.navigateTo({
      url
    })
  }
})